package com.xiguaji.tiktok.v1.tiktok.comparison.repository;

import com.xiguaji.tiktok.v1.tiktok.comparison.model.ComparisonHistory;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

public interface ComparisonHistoryRepository extends CrudRepository<ComparisonHistory,Long>,ComparisonHistoryExtRepository {

    @Query("SELECT * FROM comparison_history WHERE user_id = :userId ORDER BY create_time DESC limit 0,1")
    ComparisonHistory findByUserId(long userId);
}
